Skip Headers

Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-02 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# Re-Creating Datafiles When Backups Are Unavailable: Scenario

If a datafile is damaged and no backup of the file is available, then you can still recover the datafile if:

- All archived log files written after the creation of the original datafile are available

- The control file contains the name of the damaged file (that is, the control file is current, or is a backup taken after the damaged datafile was added to the database)

  Note: You cannot re-create any of the datafiles for the `SYSTEM` tablespace by using the `CREATE` `DATAFILE` clause of the `ALTER` `DATABASE` statement because the necessary redo is not available.

To re-create a datafile for recovery:

1. Create a new, empty datafile to replace a damaged datafile that has no corresponding backup. For example, assume that the datafile `?/oradata/trgt/users01.dbf` has been damaged, and no backup is available. The following statement re-creates the original datafile (same size) on `disk2`:

       ALTER DATABASE CREATE DATAFILE '?/oradata/trgt/users01.dbf' AS
                                      '/disk2/users01.dbf';

   This statement creates an empty file that is the same size as the lost file. The database looks at information in the control file and the data dictionary to obtain size information. The old datafile is renamed as the new datafile.

2. Perform media recovery on the empty datafile. For example, enter:

       RECOVER DATAFILE '/disk2/users01.dbf'

3. All archived logs written after the original datafile was created must be applied to the new, empty version of the lost datafile during recovery.